<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/taglibs.jsp"%>
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">  
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="${ctx}/resources/semanticui/semantic.min.css" rel="stylesheet" type="text/css" />
    <link href="${ctx}/resources/apps.css" rel="stylesheet" type="text/css" />
    <title>职位信息</title>  
</head>
<body>
<div class="ui segment" id="n-page">
<%--        &nbsp;<br>--%>
<%--        &nbsp;<br>--%>
<%--        <h3 class="ui attached header" id="list-title">--%>
<%--            职位信息--%>
<%--        </h3>--%>
        &nbsp;<br>
        &nbsp;<br>
职位：${job.name }&nbsp;<br>&nbsp;<br>
职位编号：${job.jobCode }&nbsp;<br>&nbsp;<br>
职位状态：
<c:choose>
    <c:when test="${job.status > 0 }">
        <font color='green'>正常</font>
    </c:when>
    <c:otherwise>
        <font color='red'>HOLD</font>
    </c:otherwise>
</c:choose>
<br>&nbsp;<br>
公司：
${job.companyName }&nbsp;<br>&nbsp;<br>
薪资：<c:choose>
    <c:when test="${job.annualPayment > 0}">
        ${job.annualPayment}W
    </c:when>
    <c:otherwise>
        面议
    </c:otherwise>
</c:choose><br>&nbsp;<br>

所在城市：
<c:forEach items="${cities}" var="city">
    <c:choose>
        <c:when test="${job.cityId == city.id }">
            ${city.name}
        </c:when>
    </c:choose>
</c:forEach>
&nbsp;<br>&nbsp;<br>
有效期：
${job.expiredDateStr }&nbsp;<br>&nbsp;<br>
推荐奖金：
${job.reward}元&nbsp;<br>&nbsp;<br>
负责区域：
${job.location}<br>&nbsp;<br>
下属人数：
${job.employeeNum}<br>&nbsp;<br>
主要职责：
${job.majorDuty}<br>&nbsp;<br>
职位描述：
${job.description}<br>&nbsp;<br>
期望公司来源1：
<c:forEach items="${companies}" var="company">  
    <c:choose>
        <c:when test="${job.expectcompanyid == company.id }">
            ${company.name}
        </c:when> 
    </c:choose>  
</c:forEach>
<br>&nbsp;<br>
期望公司来源2：
<c:forEach items="${companies}" var="company">  
    <c:choose>
        <c:when test="${job.expectcompanyid2 == company.id }">
            ${company.name}
        </c:when> 
    </c:choose>  
</c:forEach>
<br>&nbsp;<br>
期望公司来源3：
<c:forEach items="${companies}" var="company">  
    <c:choose>
        <c:when test="${job.expectcompanyid3 == company.id }">
            ${company.name}
        </c:when> 
    </c:choose>  
</c:forEach>
<br>&nbsp;<br>
职位有效期：
${job.expiredDateStr}<br>&nbsp;<br>
备注：
${job.comment}<br>&nbsp;<br>

<input type="hidden" name="id" id="id" value="${job.id}" />

    <div class="ui segment" id="btn-next2">
        <div class="fluid ui inverted blue button" id="liucheng" type="hidden">了解“推荐流程”</div>
    </div>

    <div class="ui segment" id="btn-next2">
       <!--  <div class="fluid ui button" id="next">推荐他人</div> -->
        <div class="fluid ui button" id="next">我要推荐</div>
    </div>

</div>
&nbsp;<br>
<!--
&nbsp;<br>&nbsp;<br>&nbsp;<br>

<div class="ui segment" id="btn-next">
    <div class="fluid ui button" id="next">推荐他人</div>
</div>
-->

<script src="${ctx}/resources/jweixin-1.0.0.js"></script>

<script src="${ctx}/resources/semanticui/jquery-2.1.4.min.js"></script>
<script src="${ctx}/resources/semanticui/semantic.js" type="text/javascript"></script>
<script type="text/javascript">

wx.config({
    debug: false, 
    appId: "${config.appid}",  
    timestamp: ${config.currenttimestamp},  
    nonceStr: "${config.nonceStr}", 
    signature: "${config.signatureStr}", 
    jsApiList: ['checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'showOptionMenu']  
});

    var handler = { 
        activate: function() { 
            $(this).addClass('active').siblings().removeClass('active'); 

            if($(this).attr('id') == 'next') {
                 var jobId = $("#id").val();
                 $(this).addClass('disabled');
                location.href =  '${ctx}/wechat/headhunter/toRecommend.do?jobId='+jobId;
                 <%--location.href =  '${ctx}/wechat/headhunter/toRecommedList.do?jobId='+jobId;--%>
            }

            if($(this).attr('id') == 'liucheng') {
                location.href = '${ctx}/wechat/headhunter/recommend/help.page';
            }
        } 
    };

    $(document).ready(function() { 
       
            $('.button').on('click', handler.activate);
            wx.ready(function() { 
            wx.onMenuShareAppMessage({
                title: 'Headoffer--${job.name}--${job.reward} 元',  
                desc: '如果你或者你的朋友符合上面这个职位，那么就推荐给我们。推荐有奖，自荐有奖，奖、奖、奖。',  
                link: 'http://www.tiaonali.com${ctx}/wechat/hunter/sharejob.page?jobid=${job.id}',  
                imgUrl: 'http://www.tiaonali.com${ctx}/resources/images/sharelogo.jpg',  
                type: 'link'
            });

            wx.onMenuShareTimeline({
                title: 'Headoffer--${job.name}--${job.reward} 元',  
                desc: '如果你或者你的朋友符合上面这个职位，那么就推荐给我们。推荐有奖，自荐有奖，奖、奖、奖。',  
                link: 'http://www.tiaonali.com${ctx}/wechat/hunter/sharejob.page?jobid=${job.id}',  
                imgUrl: 'http://www.tiaonali.com${ctx}/resources/images/sharelogo.jpg'
            });

            wx.showOptionMenu();
        });
    });

</script>
</body>
</html>